<%-- 
    Document   : pesan_ruang
    Created on : Nov 10, 2011, 3:48:25 PM
    Author     : Renaldo Malau
--%>

<%@page import="javax.swing.JOptionPane"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body bgcolor="black">
        <%
            String kamar = request.getParameter("kamar");
            String gedung = request.getParameter("gedung");
            String restoran = request.getParameter("restoran");

            if (kamar == null && gedung == null && restoran == null) {
                JOptionPane.showMessageDialog(null, "Pemesanan Gagal\npilih jenis ruang yang akan dipesan");
                response.sendRedirect("pesan_pilihJenisRuang.jsp");
            }%>

        <form action="simpanDataPesanan.jsp">

            <center><h1 style="background-color:#69F">FORM PEMESANAN<hr></h1></center><br>
            <h3 style="background-color: #cccccc">Identitas Diri</h3>
            <table>

                <tr>
                    <td>nama</td>
                    <td><input type="text" name="nama" size="25"/></td>
                </tr>
                <tr>
                    <td>Tanggal Lahir</td>
                    <td>
                        <select name="tglLahir" >
                            <option value="0">Tanggal
                                <%
                                            for (int idx = 1; idx < 32; idx++) {%>
                            <option value="<%= idx%>"><%= idx%><%}%>
                        </select>
                        <select name="blnLahir" >
                            <option value="0">Bulan
                                <%
                                            for (int idx = 1; idx <= 12; idx++) {%>
                            <option value="<%= idx%>"><%= idx%><%}%>
                        </select>
                        <select name="thnLahir">
                            <option value="0">Tahun
                                <%
                                            for (int idx = 1961; idx <= 1993; idx++) {%>
                            <option value="<%= idx%>"><%= idx%><%}%>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>Jenis Kelamin</td>
                    <td><select name="jnsKelamin">
                            <option value="Laki-Laki">Laki-Laki</option>
                            <option value="Perempuan">Perempuan</option>
                        </select></td>
                </tr>
                <tr>
                    <td>nomor telepon</td>
                    <td><input type="text" name="telepon" size="13"/></td>
                </tr>
                <tr>
                    <td>Nomor Rekening</td>
                    <td><input type="text" name="norekening"/></td>
                </tr>
                <tr>
                    <td>Nama Pemilik Rekening</td>
                    <td><input type="text" name="namaRekening"/></td>
                </tr>
            </table>



            <%
                if (kamar != null) {
            %>
            <br><h3 style="background-color: #cccccc">Pemesanan Kamar</h3>
            <table>
                <tr>
                    <td>jenis kamar</td>
                    <td><select name="jenisRuang" >
                            <option value="reguler">Reguler
                            <option value="vip">VIP
                            <option value="vvip">VVIP
                        </select></td>
                </tr>
                <tr>
                    <td>jumlah kamar</td>
                    <td><select name="jmlkamar">
                            <option value="1">1
                            <option value="2">2
                            <option value="3">3
                            <option value="4">4
                            <option value="5">5
                        </select></td>
                </tr>
                <tr>
                    <td>cek in</td>
                    <td><select name="tanggalKamarcekin" >
                            <option value="0">Tanggal
                                <%
                                            for (int idx = 1; idx < 32; idx++) {%>
                            <option value="<%= idx%>"><%= idx%><%}%>
                        </select>
                        <select name="bulanKamarcekin">
                            <option value="bulan1">Bulan ini
                            <option value="bulan2">Bulan depan
                        </select>

                        <input type="hidden" name="kamar" value="kamar"/>
                    </td>
                </tr>

            </table>

            <%}
                if (gedung != null) {
            %>
            <br><h3 style="background-color: #cccccc">Pemesanan Gedung</h3>
            <table>

                <tr>
                    <td>tanggal pakai</td>
                    <td><select name="tanggalGedungCekin" >
                            <option value="0">Tanggal
                                <%for (int idx = 1; idx < 32; idx++) {%>
                            <option value="<%= idx%>"><%= idx%><%}%>
                        </select>
                        <select name="bulanGedungCekin">
                            <option value="bulan1">Bulan ini
                            <option value="bulan2">Bulan Depan
                        </select>                                
                    </td>
                </tr>

                <input type="hidden" name="gedung" value="gedung"/>
            </table>

            <%}
                if (restoran != null) {
            %>
            <br><h3 style="background-color: #cccccc">Pemesanan Restoran</h3>
            <table>
                <tr>
                    <td>tanggal pakai</td>
                    <td><select name="tanggalRestoranCekin" >
                            <option value="0">Tanggal
                                <%for (int idx = 1; idx < 32; idx++) {%>
                            <option value="<%= idx%>"><%= idx%><%}%>
                        </select>
                        <select name="bulanRestoranCekin">
                            <option value="bulan1">Bulan ini
                            <option value="bulan2">Bulan depan
                        </select>
                    </td>
                </tr>

                <input type="hidden" name="restoran" value="restoran"/>
            </table>
            <%}%>
            <br>
            <input type="reset" value="reset"/>
            <input type="submit" value="Pesan"/>
        </form>

    </body>
</html>
